//
//  DemoSet.m
//  ocdemo
//
//  Created by JIENING ZHANG on 2019/5/5.
//  Copyright © 2019 JIENING ZHANG. All rights reserved.
//

#import "DemoSet.h"

@implementation DemoSet
+ (void)demoLogic {
    
    NSDictionary *monthDic = @{
                               @"January" :     @(31),
                               @"February" :    @(28),
                               @"March" :       @(31),
                               @"April" :       @(30),
                               @"May" :         @(31),
                               @"June" :        @(30),
                               @"July" :        @(31),
                               @"August" :      @(31),
                               @"September" :   @(30),
                               @"October" :     @(31),
                               @"November" :    @(30),
                               @"December" :    @(31),
                               };
    
    NSSet *keySet = [NSSet setWithArray:[monthDic allKeys]];
    int loop=0;
    for(NSString *obj in keySet) {
        NSLog(@"DemoSet, keySet loop, %d, %@", loop, obj);
        ++loop;
    }
    
    NSMutableSet *valueSet = [NSMutableSet set];
    
    for(NSString *key in monthDic) {
        [valueSet addObject:monthDic[key]];
    }
    
    loop=0;
    for(NSObject *obj in valueSet) {
        NSLog(@"DemoSet, valueSet loop, %d, %@", loop, obj);
        ++loop;
    }
    
}
@end
